<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="Author" content="http://www.webqin.net">
<title>共享平台</title>
<link rel="shortcut icon" href="/carworld_weixin/images/favicon.ico" />

<!-- Bootstrap -->
<link href="/carworld_weixin/css/bootstrap.min.css" rel="stylesheet">
<link href="/carworld_weixin/css/style.css" rel="stylesheet">
<link href="/carworld_weixin/css/response.css" rel="stylesheet">
</head>
<body>
	<div class="maincont">
		<header>
			<a href="javascript:history.back(-1)" class="back-off fl"> <span
				class="glyphicon glyphicon-menu-left"></span>
			</a>
			<div class="head-mid">
				<h1>申请提现</h1>
			</div>
		</header>
		<!-- <div class="head-top">
			<img src="/carworld_weixin/images/shopping_banner.jpg" />
		</div> -->
		<!--head-top/-->


		<div class="jyjl">
			<form class="form-horizontal" action="#">
				<div class="form-group">
					<label class="col-sm-2 control-label">账户余额(元)：</label>
					<div class="col-sm-10">
						<p class="form-control-static" id="balance">0.00元</p>
						<!-- <p class="form-control-static" id="balance">100.00</p> -->
					</div>
				</div>
				<div class="form-group">
					<label for="inputPassword3" class="col-sm-2 control-label">账户手机号：</label>
					<div class="col-sm-10">
						<input type="text" class="form-control" id="mobile"
							placeholder="验证您的预留手机号">
					</div>
				</div>
				<div class="form-group">
					<label for="inputEmail3" class="col-sm-2 control-label">提现金额：</label>
					<div class="col-sm-10">
						<input type="text" class="form-control" id="money"
							placeholder="单位：元">
					</div>
				</div>
				<div class="form-group">
					<label for="inputEmail3" class="col-sm-2 control-label">支付账号：</label>
					<div class="col-sm-10">
						<input type="text" class="form-control" id="account"
							placeholder="只支持支付宝提现">
					</div>
				</div>
				<div class="form-group">
					<div class="col-sm-offset-2 col-sm-10">
						<div class="checkbox">
							<label> <input type="checkbox" id="checkbox">
								本人已阅读"温馨提示",并已确认以上重要信息
							</label>
						</div>
					</div>
				</div>
				<div class="form-group">
					<div class="col-sm-offset-2 col-sm-10">
						<button class="btn bg-primary" id="submit">确认提现</button>
					</div>
				</div>
			</form>
		</div>
		<!--jyjl/-->

		<div class="jyjl">
			<div class="czts">
				<h4>温馨提示</h4>
				<br /> 1.账户余额为青铜或钻石会员的分红余额或门店的营业额，非会员卡中充值余额。<br /> 
				2.请确保您的提款信息正确，否则由于个人原因造成的经济损失，将由申请提款人自己承担 。<br />
				3.提款申请提交后，您的提现金额将从可用金额中扣除，提款操作无手续费。 <br />
				4.提款申请提交后，【共享平台】将核对提款信息，审核时间在3个工作日之内,信息确认无误后将提现金额打款至用户提供的支付宝账号中。 <br />
				5.提款时间段为每月1号全天，非提款时间段内无法申请提现。
			</div>
			<!--czts/-->
		</div>
		<!--jyjl/-->

		<div class="height1"></div>
	
   	
	</div>
	
		<!-- footNav -->
	<div class="footNav">
		<dl><a href="/carworld_weixin/"><dt><span class="glyphicon glyphicon-home"></span></dt><dd>首页</dd></a></dl>
		<dl><a href="/carworld_weixin/pages/page_myVipCard.html"><dt><span class="glyphicon glyphicon-heart"></span></dt><dd>会员卡</dd></a></dl>
		<dl><a href="/carworld_weixin/pages/page_myOrder.html"><dt><span class="glyphicon glyphicon-tasks"></span></dt><dd>订单</dd></a></dl>
		<dl><a href="/carworld_weixin/user/userPage"><dt><span class="glyphicon glyphicon-user"></span></dt><dd>我的</dd></a></dl>
		<div class="clearfix"></div> 
   	</div><!-- footNav  end-->
	<!--maincont-->
	<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
	<script src="/carworld_weixin/js/jquery-3.3.1.min.js"></script>
	<script src="/carworld_weixin/js/bootstrap.min.js"></script>
	<script>
		$(document).ready(function() {
			getBalance();
		});

		//查看账号余额
		function getBalance() {
			$.ajax({
				type : 'POST',
				url : '/carworld_weixin/withdraw/getWithdrawalBalance',
				dataType : 'json',
				success : function(result) {
					$('#balance').html(result.toFixed(2));
				},
				error : function(jqXHR, textStatus, errorThrown) {
					alert(textStatus);
				}
			});
		}

		//开始提现
		$('#submit').click(
				function() {
					var mobile = $('#mobile').val();
					var money = $('#money').val();
					var account = $('#account').val();
					var balance = $('#balance').text();

					if ($('#checkbox')[0].checked == false) {
						alert('请先阅读[温馨提示]~');
						return;
					}
					console.log('mobile：' + mobile + '----money：' + money
							+ '----balance：' + balance);
					if (mobile == '' || money == '' || account == '') {
						alert('请将提现信息补充完整~');
						return;
					}
					if(new Date().getDate()==1){
						alert('亲爱哒，只能在每月1号申请提现哦~')
						return;
					} 
					if (balance < money) {
						alert('余额不足，提现失败~');
						return;
					} else {
						balance = balance - money;
					}
					//保存提现记录
					$.ajax({
						type : 'GET',
						url : '/carworld_weixin/withdraw/saveWithdrawalRecord',
						data : {
							mobile : mobile,
							money : money,
							account : account,
							balance : balance
						},
						dataType : 'text',
						success : function(result) {
							console.log("result--》" + result);
							alert(result);
							$('#balance').html(balance);
						},
						error : function(jqXHR, textStatus, errorThrown) {
							alert("呀~出错了，请稍后再试~");
						}
					});

				})
	</script>

</body>
</html>